<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class RDoc::Markup - rdoc: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    
<div class="nav-section">
  <h3>Table of Contents</h3>

  <ul class="link-list" role="directory">
    <li><a href="#class-RDoc::Markup-label-Supported+Formats">Supported Formats</a>
    <li><a href="#class-RDoc::Markup-label-RDoc-3A-3AMarkup">RDoc::Markup</a>
    <li><a href="#class-RDoc::Markup-label-Synopsis">Synopsis</a>
    <li><a href="#class-RDoc::Markup-label-Encoding">Encoding</a>
    <li><a href="#class-RDoc::Markup-label-RDoc+Markup+Reference">RDoc Markup Reference</a>
  </ul>
</div>


    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Object.html">Object</a>
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-c-parse">::parse</a>
    <li ><a href="#method-i-add_html">#add_html</a>
    <li ><a href="#method-i-add_regexp_handling">#add_regexp_handling</a>
    <li ><a href="#method-i-add_word_pair">#add_word_pair</a>
    <li ><a href="#method-i-convert">#convert</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-RDoc::Markup">
    <h1 id="class-RDoc::Markup" class="class">
      class RDoc::Markup
    </h1>

    <section class="description">
    
<p><a href="Markup.html"><code>RDoc::Markup</code></a> parses plain text documents and attempts to decompose them into their constituent parts.  Some of these parts are high-level: paragraphs, chunks of verbatim text, list entries and the like.  Other parts happen at the character level: a piece of bold text, a word in code font.  This markup is similar in spirit to that used on WikiWiki webs, where folks create web pages using a simple set of formatting rules.</p>

<p><a href="Markup.html"><code>RDoc::Markup</code></a> and other markup formats do no output formatting, this is handled by the <a href="Markup/Formatter.html"><code>RDoc::Markup::Formatter</code></a> subclasses.</p>

<h1 id="class-RDoc::Markup-label-Supported+Formats">Supported Formats<span><a href="#class-RDoc::Markup-label-Supported+Formats">&para;</a> <a href="#top">&uarr;</a></span></h1>

<p>Besides the <a href="Markup.html"><code>RDoc::Markup</code></a> format, the following formats are built in to RDoc:</p>
<dl class="rdoc-list note-list"><dt>markdown
<dd>
<p>The markdown format as described by <a href="http://daringfireball.net/projects/markdown">daringfireball.net/projects/markdown</a>/.  See <a href="Markdown.html"><code>RDoc::Markdown</code></a> for details on the parser and supported extensions.</p>
</dd><dt>rd
<dd>
<p>The rdtool format.  See <a href="RD.html"><code>RDoc::RD</code></a> for details on the parser and format.</p>
</dd><dt>tomdoc
<dd>
<p>The TomDoc format as described by <a href="http://tomdoc.org">tomdoc.org</a>/.  See <a href="TomDoc.html"><code>RDoc::TomDoc</code></a> for details on the parser and supported extensions.</p>
</dd></dl>

<p>You can choose a markup format using the following methods:</p>
<dl class="rdoc-list note-list"><dt>per project
<dd>
<p>If you build your documentation with rake use <a href="Task.html#attribute-i-markup"><code>RDoc::Task#markup</code></a>.</p>

<p>If you build your documentation by hand run:</p>

<pre>rdoc --markup your_favorite_format --write-options</pre>

<p>and commit <code>.rdoc_options</code> and ship it with your packaged gem.</p>
</dd><dt>per file
<dd>
<p>At the top of the file use the <code>:markup:</code> directive to set the default format for the rest of the file.</p>
</dd><dt>per comment
<dd>
<p>Use the <code>:markup:</code> directive at the top of a comment you want to write in a different format.</p>
</dd></dl>

<h1 id="class-RDoc::Markup-label-RDoc-3A-3AMarkup"><a href="Markup.html"><code>RDoc::Markup</code></a><span><a href="#class-RDoc::Markup-label-RDoc-3A-3AMarkup">&para;</a> <a href="#top">&uarr;</a></span></h1>

<p><a href="Markup.html"><code>RDoc::Markup</code></a> is extensible at runtime: you can add new markup elements to be recognized in the documents that <a href="Markup.html"><code>RDoc::Markup</code></a> parses.</p>

<p><a href="Markup.html"><code>RDoc::Markup</code></a> is intended to be the basis for a family of tools which share the common requirement that simple, plain-text should be rendered in a variety of different output formats and media.  It is envisaged that <a href="Markup.html"><code>RDoc::Markup</code></a> could be the basis for formatting <a href="../RDoc.html"><code>RDoc</code></a> style comment blocks, Wiki entries, and online FAQs.</p>

<h2 id="class-RDoc::Markup-label-Synopsis">Synopsis<span><a href="#class-RDoc::Markup-label-Synopsis">&para;</a> <a href="#top">&uarr;</a></span></h2>

<p>This code converts <code>input_string</code> to HTML.  The conversion takes place in the <code>convert</code> method, so you can use the same <a href="Markup.html"><code>RDoc::Markup</code></a> converter to convert multiple input strings.</p>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;rdoc&#39;</span>

<span class="ruby-identifier">h</span> = <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Markup</span><span class="ruby-operator">::</span><span class="ruby-constant">ToHtml</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Options</span>.<span class="ruby-identifier">new</span>)

<span class="ruby-identifier">puts</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input_string</span>)
</pre>

<p>You can extend the <a href="Markup.html"><code>RDoc::Markup</code></a> parser to recognize new markup sequences, and to add regexp handling. Here we make WikiWords significant to the parser, and also make the sequences {word} and &lt;no&gt;text…&lt;/no&gt; signify strike-through text.  We then subclass the HTML output class to deal with these:</p>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;rdoc&#39;</span>

<span class="ruby-keyword">class</span> <span class="ruby-constant">WikiHtml</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Markup</span><span class="ruby-operator">::</span><span class="ruby-constant">ToHtml</span>
  <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">handle_regexp_WIKIWORD</span>(<span class="ruby-identifier">target</span>)
    <span class="ruby-string">&quot;&lt;font color=red&gt;&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">target</span>.<span class="ruby-identifier">text</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;&lt;/font&gt;&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span>

<span class="ruby-identifier">markup</span> = <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Markup</span>.<span class="ruby-identifier">new</span>
<span class="ruby-identifier">markup</span>.<span class="ruby-identifier">add_word_pair</span>(<span class="ruby-string">&quot;{&quot;</span>, <span class="ruby-string">&quot;}&quot;</span>, <span class="ruby-value">:STRIKE</span>)
<span class="ruby-identifier">markup</span>.<span class="ruby-identifier">add_html</span>(<span class="ruby-string">&quot;no&quot;</span>, <span class="ruby-value">:STRIKE</span>)

<span class="ruby-identifier">markup</span>.<span class="ruby-identifier">add_regexp_handling</span>(<span class="ruby-regexp">/\b([A-Z][a-z]+[A-Z]\w+)/</span>, <span class="ruby-value">:WIKIWORD</span>)

<span class="ruby-identifier">wh</span> = <span class="ruby-constant">WikiHtml</span>.<span class="ruby-identifier">new</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Options</span>.<span class="ruby-identifier">new</span>, <span class="ruby-identifier">markup</span>
<span class="ruby-identifier">wh</span>.<span class="ruby-identifier">add_tag</span>(<span class="ruby-value">:STRIKE</span>, <span class="ruby-string">&quot;&lt;strike&gt;&quot;</span>, <span class="ruby-string">&quot;&lt;/strike&gt;&quot;</span>)

<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;&lt;body&gt;#{wh.convert ARGF.read}&lt;/body&gt;&quot;</span>
</pre>

<h2 id="class-RDoc::Markup-label-Encoding">Encoding<span><a href="#class-RDoc::Markup-label-Encoding">&para;</a> <a href="#top">&uarr;</a></span></h2>

<p>Where Encoding support is available, <a href="../RDoc.html"><code>RDoc</code></a> will automatically convert all documents to the same output encoding.  The output encoding can be set via <a href="Options.html#attribute-i-encoding"><code>RDoc::Options#encoding</code></a> and defaults to Encoding.default_external.</p>

<h1 id="class-RDoc::Markup-label-RDoc+Markup+Reference">RDoc <a href="Markup.html"><code>Markup</code></a> Reference<span><a href="#class-RDoc::Markup-label-RDoc+Markup+Reference">&para;</a> <a href="#top">&uarr;</a></span></h1>

<p>See RDoc::MarkupReference.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">



        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-attribute_manager" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">attribute_manager</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>An <a href="Markup/AttributeManager.html"><code>AttributeManager</code></a> which handles inline markup.</p>
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(attribute_manager = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Take a block of text and use various heuristics to determine its structure (paragraphs, lists, and so on).  Invoke an event handler as we identify significant chunks.</p>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rdoc/markup.rb, line 146</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span> <span class="ruby-identifier">attribute_manager</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@attribute_manager</span> = <span class="ruby-identifier">attribute_manager</span> <span class="ruby-operator">||</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Markup</span><span class="ruby-operator">::</span><span class="ruby-constant">AttributeManager</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@output</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-parse" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">parse</span><span
                                class="method-args">(str)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Parses <code>str</code> into an <a href="Markup/Document.html"><code>RDoc::Markup::Document</code></a>.</p>

                              <div class="method-source-code" id="parse-source">
            <pre><span class="ruby-comment"># File rdoc/markup.rb, line 116</span>
  <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">parse</span> <span class="ruby-identifier">str</span>
    <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Markup</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">parse</span> <span class="ruby-identifier">str</span>
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Markup</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
    <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">&lt;&lt;-EOF</span>
<span class="ruby-value">While parsing markup, RDoc encountered a #{e.class}:

#{e}
\tfrom #{e.backtrace.join &quot;\n\tfrom &quot;}

---8&lt;---
#{text}
---8&lt;---

RDoc #{RDoc::VERSION}

Ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} #{RUBY_RELEASE_DATE}

Please file a bug report with the above information at:

https://github.com/ruby/rdoc/issues

</span><span class="ruby-identifier">    EOF</span>
    <span class="ruby-identifier">raise</span>
  <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-add_html" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_html</span><span
                                class="method-args">(tag, name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Add to the sequences recognized as general markup.</p>

                              <div class="method-source-code" id="add_html-source">
            <pre><span class="ruby-comment"># File rdoc/markup.rb, line 163</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_html</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">name</span>)
  <span class="ruby-ivar">@attribute_manager</span>.<span class="ruby-identifier">add_html</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_regexp_handling" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_regexp_handling</span><span
                                class="method-args">(pattern, name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Add to other inline sequences.  For example, we could add WikiWords using something like:</p>

<pre class="ruby"><span class="ruby-identifier">parser</span>.<span class="ruby-identifier">add_regexp_handling</span>(<span class="ruby-regexp">/\b([A-Z][a-z]+[A-Z]\w+)/</span>, <span class="ruby-value">:WIKIWORD</span>)
</pre>

<p>Each wiki word will be presented to the output formatter.</p>

                              <div class="method-source-code" id="add_regexp_handling-source">
            <pre><span class="ruby-comment"># File rdoc/markup.rb, line 175</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_regexp_handling</span>(<span class="ruby-identifier">pattern</span>, <span class="ruby-identifier">name</span>)
  <span class="ruby-ivar">@attribute_manager</span>.<span class="ruby-identifier">add_regexp_handling</span>(<span class="ruby-identifier">pattern</span>, <span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_word_pair" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_word_pair</span><span
                                class="method-args">(start, stop, name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Add to the sequences used to add formatting to an individual word (such as <strong>bold</strong>).  Matching entries will generate attributes that the output formatters can recognize by their <code>name</code>.</p>

                              <div class="method-source-code" id="add_word_pair-source">
            <pre><span class="ruby-comment"># File rdoc/markup.rb, line 156</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_word_pair</span>(<span class="ruby-identifier">start</span>, <span class="ruby-identifier">stop</span>, <span class="ruby-identifier">name</span>)
  <span class="ruby-ivar">@attribute_manager</span>.<span class="ruby-identifier">add_word_pair</span>(<span class="ruby-identifier">start</span>, <span class="ruby-identifier">stop</span>, <span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-convert" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">convert</span><span
                                class="method-args">(input, formatter)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>We take <code>input</code>, parse it if necessary, then invoke the output <code>formatter</code> using a Visitor to render the result.</p>

                              <div class="method-source-code" id="convert-source">
            <pre><span class="ruby-comment"># File rdoc/markup.rb, line 183</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">convert</span> <span class="ruby-identifier">input</span>, <span class="ruby-identifier">formatter</span>
  <span class="ruby-identifier">document</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">input</span>
             <span class="ruby-keyword">when</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Markup</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span> <span class="ruby-keyword">then</span>
               <span class="ruby-identifier">input</span>
             <span class="ruby-keyword">else</span>
               <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Markup</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">parse</span> <span class="ruby-identifier">input</span>
             <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">document</span>.<span class="ruby-identifier">accept</span> <span class="ruby-identifier">formatter</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

